import React, {Component} from 'react';
import {Form,Input,Icon, Result, Button } from 'antd';
import './index.scss'

class login extends Component {
  constructor(props) {
    super(props);
    this.state = {};
  }

  //commit处理
  handleSubmit = e => {
        console.log(e);
        this.props.history.push('/main');
  };

  render() {
    return (
      <div className="loginpagewrap">
        <div className="box">
          <div className="loginWrap">
            <Form onFinish={this.handleSubmit} className="login-form">
              <Form.Item
                label="Username"
                name="username"
                rules={[{ required: true, message: 'Please input your username!' }]}
              >
                  <Input
                    prefix={<Icon type="user" style={{ color: 'rgba(0,0,0,.25)' }} />}
                    placeholder="请输入用户名"
                  />
              </Form.Item>
              <Form.Item
                label="Password"
                name="password"
                rules={[{ required: true, message: 'Please input your password!' }]}
              >
                <Input.Password />
              </Form.Item>
              <Form.Item>
                <Button type="primary" htmlType="submit" className="login-form-button loginBtn">
                  登录
                </Button>
              </Form.Item>
            </Form>
          </div>
        </div>
      </div>
      
    )
  }
}

export default login;
